#!/bin/bash
D_PATH="$DIDIENV_DEPS_DEPLOY_PATH"


######################## [环境检测匹配站点] ####################################
#
site=$DIDIENV_ODIN_CLUSTER
# server.[].conf创建
readonly CONF_FILE=$D_PATH/server.$site.conf

if [[ ! -f $CONF_FILE ]];then
    echo "[error] $CONF_FILE is not exist."
    exit 1
fi

# 打印配置文件内容
server_conf_ctx=`cat $CONF_FILE`
echo -e "[server.conf] \n$server_conf_ctx\n"



######################## [文件部署] ####################################
#
# cp $D_PATH/server.conf /home/xiaoju/nginx/conf/conf.d/
#cp $CONF_FILE /home/xiaoju/nginx/conf/conf.d/
cp $CONF_FILE /home/xiaoju/openresty/nginx/conf/conf.d/

cp -f /etc/container/init_scripts/control.sh $D_PATH/
chown -R xiaoju:xiaoju $D_PATH

